import React from 'react'

type Props = {}

const App = (props: Props) => {
  //去重
  const quchong=new Set([1,1,1,2,2,2,3]);
  console.log('去重',quchong);

  const qh=(a:number[])=>{
    const un=Array.from(new Set(a))
    const sum=un.reduce((w,x)=>w+x,0);
    return sum
  }
  //去重求和
  const he=(a:number[])=>{
    const un=Array.from(new Set(a));
    const sum=un.reduce((x,y)=>x+y,0)
  
    return sum
  }
  const number=[1,1,1,2,2,2,3];
  const result=he(number);
  console.log(result);
  
 
  return (
    <div>{quchong}{result}</div>
  )
}

export default App